<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>早读古诗词</title>
    <link rel="stylesheet" href="{{ url_for('static', filename='css/index.css') }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='css/bootstrap.min.css') }}">
</head>

<body>
    {% for verses in verse %}
        <div class="box">
            <div class="me">
                <div style="margin-top: 2%;" class="text-center">
                    <!-- 标题和作者 -->
                    
                    <h1><strong>{{ verses['title'] }}</strong></h1>
                    <br>
                    <span class="text-secondary" style="font-size: 20px;">{{ verses['author'] }}</span>
                    <br>
                    <br>
                    <div id="poemText{{ verses['poem_id'] }}">
                        <span>
                            <strong>{{ verses.poem_text }}</strong>
                        </span>
                    </div>
                    <br>
                </div>
            </div>
        </div>
        
        <script>
            // 获取诗句文本元素
            var poemText = document.getElementById('poemText{{ verses.poem_id }}');
             // 获取诗句文本内容
             var textContent = poemText.textContent;
             // 在<br>处插入换行符
             var newTextContent = textContent.replace(/<br>/g, '<br>\n');
             // 更新诗句文本内容
             poemText.innerHTML = newTextContent;
             // 修改文字大小
             poemText.style.fontSize = '40px';
         </script>
    {% endfor %}
</body>

</html>
